import { Component } from "@angular/core";
import { AlertController } from "ionic-angular";
import { NavController } from "ionic-angular";
import { HomePage } from "../home/home";
import { Camera, CameraOptions } from "@ionic-native/camera";
import { WorkSumPage } from "../work-sum/work-sum";
/**
 * 详细备注
 */
@Component({
  templateUrl: "detail-remarks.html"
})
export class DeatilRemarksPage {
  private isChose: number = 1; //登录人员类型选择
  private autoManufacturers: string;
  constructor(
    public navCtrl: NavController,
    private alertCtrl: AlertController,
    private camera: Camera
  ) {}
  doCamera() {
    let options: CameraOptions = {
      quality: 85, // destinationType: this.camera.DestinationType.DATA_URL,
      // encodingType: this.camera.EncodingType.JPEG,
      mediaType: this.camera.MediaType.PICTURE,
      targetWidth: 1500,
      targetHeight: 1500,
      correctOrientation: true
    };
    this.camera.getPicture(options).then(
      imageData => {
        // imageData is either a base64 encoded string or a file URI
        // If it's base64:
        alert(imageData);
        alert("success");
      },
      err => {
        // Handle error
      }
    );
  }
  doConfirm() {
    this.navCtrl.push(WorkSumPage);
  }
}
